<template>
  <el-dialog title="近三天【数据治理管理-数据治理开发-脚本式开发】任务执行失败列表" :close-on-click-modal="false" style="z-index: 99999999;"
    :visible.sync="dialogVisible" width="60%">
    <div class="top">
    </div>
    <div class="center">
      <el-table :data="getList" border max-height='400'>
        <el-table-column align="center" prop="jobName" label="执行失败任务名称"> </el-table-column>
        <el-table-column align="center" label="执行失败时间">
          <template #default='{ row }'>
            {{ row.createTime == null ? "" : row.createTime }}
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="buttom">
      <el-row>
        <el-col :span="12" v-permission="['DynamicJob:DynamicJob:changeRemind']">

          <el-switch :disabled="isbool1" v-model="temp.notRemind" active-color="#13ce66" inactive-color="#ff4949"
            :active-value="1" :inactive-value="0"> </el-switch>
          今日不再提醒
        </el-col>
        <el-col :span="12"> <el-button style='float: right;' type="primary" @click="btnFun">确定</el-button></el-col>
      </el-row>
    </div>
  </el-dialog>
</template>

<script>

import { getchangeRemind, getqueryJobRunStatus } from "@/api/errorLogin/index"
import permission from '@/directive/permission/permission'
import dayjs from "dayjs"
export default {
  props: ['getList'],
  directives: { permission },
  data() {
    return {
      isbool: false,
      isbool1: false,
      dialogVisible: true,
      temp: {
      },
    }
  },
  mounted() {
    getqueryJobRunStatus().then(res => {
      if (res.data.code == 200) {
        if (!res.data.data.warning) {
          this.temp.notRemind = 1
          this.isbool1 = true
        } else {
          this.temp.notRemind = 0
          this.isbool1 = false
        }

      }
    })
  },

  methods: {
    fun(item) {
      this.isbool = item
    },
    btnFun() {
      if (this.temp.notRemind == 1) {
        getchangeRemind().then(res => {
          console.log(res);
        })
      }
      this.$emit("off")
    },

  }
}
</script>
<style lang="scss" scoped>
.center {
  width: 100%;
  height: 80%;
}

.buttom {
  width: 100%;
  height: 20%;
  margin-top: 10px;
  display: block;
}

::v-deep(.el-dialog__headerbtn) {
  display: none !important;
}
</style>
